Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make queues own the resources of executing operations #2001

Merged
merged 1 commit into from
Sep 24, 2022

Conversation

Rua
Copy link
Contributor

@Rua Rua commented Sep 24, 2022

Changelog:

### Breaking changes
Changes to queue operations:
- `Queue` now implements `VulkanObject` instead of `SynchronizedVulkanObject`, which is removed.
- `Queue` now takes ownership of resources belonging to operations that you execute on it, to keep them from being destroyed while in use.
- `QueueGuard` now has a `cleanup_finished` method, which does the same thing as on futures. Calling this method on a future will automatically forward it to its queue.
- If `Queue` is dropped, it will call `wait_idle` to block the current thread until all operations on it have completed.

This completes the step in making queues responsible for their own resources, rather than leaving that to futures. In theory, a queue could now be (unsafe-ly) used without needing a future at all. For now though, the queue operation methods are still pub(crate).

Copy link
Member

@AustinJ235 AustinJ235 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good!

@AustinJ235 AustinJ235 merged commit ac3fa2a into vulkano-rs:master Sep 24, 2022
AustinJ235 added a commit that referenced this pull request Sep 24, 2022
@Rua Rua deleted the queue-ownership branch October 4, 2022 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants